package org.zhxy.core.personnel.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.zhxy.entity.personnel.TeacherDepartment;
import org.zhxy.entity.principal.Department;

import java.util.List;

@Mapper
public interface TeacherDepartmentMapper extends BaseMapper<TeacherDepartment> {



    @Select("SELECT d.* " +
            "FROM sc_teacher t, sc_department d, sc_teacher_department td " +
            "WHERE t.`id` = td.`teacher_id` " +
            "AND td.`department_id` = d.`id` " +
            "AND td.`status` = '1' " +
            "AND t.`id` = #{id} ")
    List<Department> searchDepartmentListByTeacherId(String id);
}
